﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using AStar.Collections;
using AStar.Class;
using AStar.LogicClass;

namespace AStar
{
    public partial class Form1 : Form
    {
        Logic log = new Logic();
        TestDataGen gen = new TestDataGen();
        public Form1()
        {
            InitializeComponent();
            ResizeRedraw = true;
        }

        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            gen.Height = display1.Height;
            gen.Width = display1.Width;
            //MyList<int> test = new MyList<int>();
            //OpenList<int> test = new OpenList<int>();

            /*test.add(1);
            test.add(50);
            test.add(4);
            test.add(3);

            for (int i = 0; i < test.Count(); i++)
            {
                MessageBox.Show(test.get(i) + "");
            }
            */
            /*MyHash<String, int> test2 = new MyHash<string, int>();
            test2["a"] = 2;
            test2["b"] = 3;

            MessageBox.Show(test2["a"] + "");

            MessageBox.Show(test2["b"] + "");
            MessageBox.Show(test2.exists("a")+"");*/
            /*MyHash<String, City> test3 = new MyHash<string, City>();
            City a = new City("a", 1, 1);
            City b = new City("b", 3, 3);
            test3[a.Name] = a;
            test3[b.Name] = b;
            MyList<String>  temp = test3.Keys();
            for (int i = 0; i < temp.Count(); i++)
            {
                MessageBox.Show(temp.Get(i));
            }
              */
            //MessageBox.Show(test3.exists(a.Name) + "");
            //a.estimate(b);
            //MessageBox.Show(a.Lenght + "");
            //OpenList<City> test4 = new OpenList<City>();
            //a.Lenght = 5;
            //b.Lenght = 3;
            //test4.add(a);
            //test4.add(b);

            /*for (int i = 0; i < test4.Count(); i++)
            {
                MessageBox.Show(test4.get(i).Name);
            }*/
            /*Logic test5 = new Logic();
            City a = new City("a", 1, 1);
            City b = new City("b", 3, 10);
            City c = new City("c", 10, 3);
            City d = new City("d", 3, 5);

            test5.AddStreet(a, b, 5);
            test5.AddStreet(a, c, 3);
            test5.AddStreet(b, c, 6);
            test5.AddStreet(b, d, 7);

            test5.GetShortestRoute(a,d);*/
            
            gen.MaxLength = 1000;
            display1.Log = gen.Generate(100);
            display1.ShortestRoute(display1.Log.Cities.Get(1), display1.Log.Cities.Get(3));
        }

        private void Form1_Resize(object sender, EventArgs e)
        {

        }

        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            log.Load("C:\\Test");
        }

        private void saveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            log.Save("C:\\Test");
        }
    }
}
